package com.nhxcz.bigdataweb.controller;

import com.nhxcz.bigdataweb.entity.History;
import com.nhxcz.bigdataweb.mapper.ForecastMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.Date;

@RestController
public class ForecastController {

    @Autowired
    private ForecastMapper forecastMapper;

    @GetMapping("/CurrentData")
    public ArrayList<History> getCurrentData() {
        System.out.println(new Date() + "  getCurrentData");
        return forecastMapper.getCurrentData();
    }

    @GetMapping("/PredictData")
    public ArrayList<History> getPredictData() {
        System.out.println(new Date() + "  getPredictData");
        return forecastMapper.getPredictData();
    }

}
